<template>
    <div class="list-container">
        <div class="list-title">最新评论({{comment.length}})</div>
        <ul> 
            <li class="li"  v-for="(item,index) of comment" :key="index">
               <div class="img-C">
                   <img :src="item.Image" alt="">
               </div>
               <div class="right-C">
                   <div class="first-R">
                       <div class="name">
                           {{item.name}}
                       </div>
                       <div class="good">
                           <span class="good-C">{{item.likeCount}}</span>
                           <span @click="clickLike(index)" class="iconfont icon">&#xe680;</span>
                       </div>
                   </div>
                   <div class="time">
                       {{item.time}}
                   </div>
                   <div class="content">
                       {{item.content}}
                   </div>
               </div>
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    methods: {
        clickLike(index) {
            this.$emit('clickLike',index)
        }
    },
    props: {
        comment: {
            type: Array,
            default() {
                return []
            }
        }
    }
}
</script>

<style lang="scss" scoped>
    .list-title {
        width: 100%;
        height: 60px;
        padding: 0 25px;
        color: #666;
        line-height: 60px;
        background-color: #eeeff0;
    }
    ul {
       display: flex;
       flex-direction: column;
        li {
            display: flex;
            padding-top: 30px;
            padding-left: 30px;
            padding-right: 30px;
            padding-bottom: 40px;
            flex-direction: row;
            border-bottom: 1px solid #999;
            .img-C  {
                //    width: 100px;
                flex: 1;
                height: 80px;
                display: flex;
                justify-content: center;
                img {
                    width: 80px;
                    height: 80px;
                    border-radius: 50%;
                }
            }
            .right-C {
                padding-top: 5px;
                box-sizing: border-box;
                flex: 8;
                display: flex;
                flex-direction: column;
                margin-left: 20px;
                .first-R {
                    display: flex;
                    flex-direction: row;
                    align-items: center;
                    justify-content: space-between;
                    .name {
                        font-size: 36px;
                        color: #666;
                        line-height: 50px;
                        overflow: hidden;
                        height: 50px;
                        text-overflow: ellipsis;
                        white-space: nowrap;
                    }
                    .good {
                        position: relative;
                        font-size: 28px;
                        color: #999;
                        .good-C {
                            position: absolute;
                            right: 60px;
                            bottom: 13px;
                        }
                        .icon {
                            font-size: 50px;
                            color: #999;
                        }
                    }
                }
                .time {
                    font-size: 26px;
                    color: #666;
                    margin-top: 4px;
                }
                .content {
                    margin-top: 25px;
                    font-size: 40px;
                    line-height: 50px;
                    color: #333;
                    width: 90%;
                }
            }
        }
    }
</style>